﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<ThietBiSo.LinQDB.XayDung_DanhMuc>" %>

<%@ Import Namespace="ThietBiSo.LinQDB" %>
<%@ Import Namespace="ThietBiSo.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Website - bảng điều khiển
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
     
        XayDung_DanhMuc tt = (XayDung_DanhMuc)ViewData["xaydung_danhmuc"];
      
    %>
    <script type="text/javascript">
        function submitForm() {
            if (checkForm()) {
                document.forms[0].submit();
            }
        }
        function checkForm() {
            var flag = true;
            var F = document.forms[0];
            var TieuDe = document.getElementById("TenDanhMuc").value;     

            if (TieuDe == null || TieuDe == "") {
                alert("Chưa nhập tiêu đề");
                F.TenDanhMuc.focus();
                flag = false;

            }
           
            return flag;
        }
    </script>
    <% using (Html.BeginForm("Edit", "xaydung_danhmuc", FormMethod.Post, new { @enctype = "multipart/form-data" }))
       { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend class="classFieldSet">Sửa danh mục xây dựng</legend>
        <table width="100%">
            <tr style="background-color: #e0e0e0">
                <td class="classCreate">
                    <input type="button" value="Lưu" class="btn" onclick="submitForm();" />
                </td>
                <td class="classBack">
                    <%: Html.ActionLink("Quay lại", "",null,new { @class = "classThem" })%>
                </td>
            </tr>
            <tr>
                <td class="tableLabel">
                    Tiêu đề danh mục
                </td>
                <td class="tableField">
                    <%:Html.TextBox("TenDanhMuc", tt.TenDanhMuc, new { @style = "width:600px" })%>
                </td>
            </tr>
          
            <tr>
                <td class="tableLabel">
                    Thứ tự
                </td>
                <td class="tableField">
                    <%:Html.TextBox("ThuTu", tt.ThuTu)%>
                </td>
            </tr>
        </table>
    
    </fieldset>
    <% } %>
</asp:Content>

